//核对订单 
function submitOrders(){
	var shoppingCartId = $("input[name='shoppingCartId']").val(),
		goodsId = $("input[name='goodsId']").val(),
		useYear = $("input[name='yearsMin']").val(),
		userNum = $("input[name='usersMin']").val(),
		userId = $("input[name='userId']").val(),
		finallySumPrice = $("#finallySumPrice").html();
	
	if(Number(finallySumPrice) == 0 ){
		var loading = function(html,callback){
			var dialog = null;
	        dialog = $.dialog({
	            id: 'loading',
	            fixed:true,
	            title:false,
	            lock:true,
	            padding:'10px 20px',
	            content: '<div class="loading-tip">'+html+'</div>'
	        });
	    }
		loading('<span style="color:red;font-size:16px;">数据正在同步,时长约为1分钟！请耐心等待！<br>请勿刷新该页面，否则数据同步将会失败！</span>');	
	}
	
	$.ajax({
		type:"POST",
		url:"/buy/checkToSubmit",
		timeout:100000, //超时时间是100秒
		data:{
			goodsId:goodsId,
			useYear:useYear,
			userNum:userNum,
			userId:userId,
			shoppingCartId:shoppingCartId 
		},
		success:function(data){
			if(data.isSuccess){
				if(data.orderMoney == 0.00){
					location.href="/buy/successOrder";
				}else{
					location.href="/buy/submitOrders";
				}
			}else {
				BSTYUN.dialog.warn("网络异常，请求失败！");
			}
		}
	})
}